# ======================================================================================
# File         : cpp.snippets
# Author       : Wu Jie 
# Last Change  : 06/16/2009 | 15:18:52 PM | Tuesday,June
# Description  : 
# ======================================================================================

# ------------------------------------------------------------------ 
# Desc: Namespace
# ------------------------------------------------------------------ 

snippet ns
	// #########################
	namespace ${1:name} {
	// #########################

		${2:/* TODO: code */}

	// #########################
	} // end namespace $1
	// #########################

# ------------------------------------------------------------------ 
# Desc: Class
# ------------------------------------------------------------------ 

snippet cl
	///////////////////////////////////////////////////////////////////////////////
	// class $1
	// 
	// Purpose: 
	// 
	///////////////////////////////////////////////////////////////////////////////

	class ${1:name} 
	{
		///////////////////////////////////////////////////////////////////////////////
		// typedefs 
		///////////////////////////////////////////////////////////////////////////////
		
	public:

		typedef $1 self_t;

		///////////////////////////////////////////////////////////////////////////////
		// constructor & destructor
		///////////////////////////////////////////////////////////////////////////////

	public:

		// constructor & destructor
		$1 ();
		virtual ~$1 ();

		// copy constructor
		$1 ( const self_t& _copy );
		self_t& operator = ( const self_t& _copy );
	
		///////////////////////////////////////////////////////////////////////////////
		// protected members
		///////////////////////////////////////////////////////////////////////////////

	protected:

		${2:/* TODO: members */}
	}; // end class $1 

# # Read File Into Vector
# snippet readfile
# 	std::vector<char> v;
# 	if ( FILE *${2:fp} = fopen(${1:"filename"}, "r") ) 
# 	{
# 		char buf[1024];
# 		while (size_t len = fread(buf, 1, sizeof(buf), $2))
# 			v.insert(v.end(), buf, buf + len);
# 		fclose($2);
# 	}${3}
# # std::map
# snippet map
# 	std::map<${1:key}, ${2:value}> map${3};
# # std::vector
# snippet vector
# 	std::vector<${1:char}> v${2};

# ------------------------------------------------------------------ 
# Desc: eResult 
# ------------------------------------------------------------------ 

snippet eres
	EResult eResult = eResult_OK;

	${2:/* TODO: code */}

	return eResult;

# ------------------------------------------------------------------ 
# Desc: 
# ------------------------------------------------------------------ 

snippet tpl
	template < typename T >
